/**
* Copyright (C) 2018-2020
* All rights reserved, Designed By www.yixiang.co
* 注意：
* 本软件为www.yixiang.co开发研制，未经购买不得使用
* 购买后可获得全部源代码（禁止转卖、分享、上传到码云、github等开源平台）
* 一经发现盗用、分享等行为，将追究法律责任，后果自负
*/
package co.yixiang.modules.auction.service.mapper;

import co.yixiang.common.mapper.CoreMapper;
import co.yixiang.modules.auction.domain.Authentication;
import co.yixiang.modules.auction.service.dto.AuthenticationDto;
import co.yixiang.modules.auction.service.dto.AuthenticationQueryCriteria;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* @author yhh
* @date 2021-02-20
*/
@Repository
public interface AuthenticationMapper extends CoreMapper<Authentication> {


    @Select("<script> select a.* ,u.nickname as uName from yx_authentication a " +
            " left join yx_user u on a.uid=u.uid where 1 = 1 " +
            " <if test=\"uName != null and uName != ''\"> and u.nickname  like CONCAT('%',#{uName},'%')</if> " +
            " <if test=\"realName != null and realName != ''\"> and a.real_name  like CONCAT('%',#{realName},'%')</if> " +
            " <if test=\"status != null\"> and a.status=#{status} </if> </script>")
    List<AuthenticationDto> selectAuthenticationList(AuthenticationQueryCriteria criteria);
}
